import i18n from '@app-base/common/utils/i18next';
import {
  ENTITY_TYPE_EDGE,
  ENTITY_TYPE_FACE,
  ENTITY_TYPE_VERTEX,
  NMMeshBaseCommand,
} from '@app-nextmesh/types';
import BaseCollectionDialog from './BaseCollection';
import { schema } from './jsonSchema';

const CollectionType = 'Node';
export const cmdNode: NMMeshBaseCommand = {
  id: 'cmdNode',
  label: 'command.collection.node',
  icon: 'commands/simu/nodes',
  create: (label, onClose, _, customParams) => (
    <BaseCollectionDialog
      title={i18n.t(label)}
      onClose={onClose}
      params={customParams}
      pickTypes={[ENTITY_TYPE_FACE, ENTITY_TYPE_EDGE, ENTITY_TYPE_VERTEX]}
      collectionType={CollectionType}
      schema={schema}
    />
  ),
};
